package com.huawei.esdk.tp.northcommu.cxf.professional;

import org.apache.cxf.common.util.CollectionUtils;
import org.apache.log4j.Logger;

import com.huawei.esdk.platform.common.SDKErrorCode;
import com.huawei.esdk.platform.common.exception.SDKException;
import com.huawei.esdk.platform.common.utils.StringUtils;
import com.huawei.esdk.tp.business.professional.confctrl.ConfCtrlService;
import com.huawei.esdk.tp.common.ErrInfo;
import com.huawei.esdk.tp.domain.model.bean.ContinuousPresenceParam;
import com.huawei.esdk.tp.northcommu.cxf.professional.convert.TPProfessionalConfCtrlConvert;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.DisplayConfSiteLocalVideoEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.DisplayConfSiteLocalVideoExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.HideConfSiteLocalVideoEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.HideConfSiteLocalVideoExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.LockPresentationEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.LockPresentationExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.ReleaseConfChairEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.ReleaseConfChairExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.RequestConfChairEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.RequestConfChairExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetAudioSwitchEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetAudioSwitchExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetBroadcastContinuousPresenceEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetBroadcastContinuousPresenceExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetBroadcastSiteEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetBroadcastSiteExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetConfSiteVolumeEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetConfSiteVolumeExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetContinuousPresenceEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetContinuousPresenceExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetFloorEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetFloorExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetSitesMuteEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetSitesMuteExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetSitesQuietEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetSitesQuietExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetVideoSourceEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.SetVideoSourceExResponse;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.TPProfessionalConfCtr;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.UnlockPresentationEx;
import com.huawei.esdk.tp.northcommu.cxf.professional.gen.UnlockPresentationExResponse;

/** * @author w00208247 * * */
public class TPProfessionalConfCtrImpl implements TPProfessionalConfCtr
{
    private ConfCtrlService confCtrlService;
    
    private TPProfessionalConfCtrlConvert tpProfessionalConfCtrlConvert;
    
    private static final Logger LOGGER = Logger.getLogger(TPProfessionalConfCtrImpl.class);
    
    public TPProfessionalConfCtrlConvert getTpProfessionalConfCtrlConvert()
    {
        return tpProfessionalConfCtrlConvert;
    }
    
    public void setTpProfessionalConfCtrlConvert(TPProfessionalConfCtrlConvert tpProfessionalConfCtrlConvert)
    {
        this.tpProfessionalConfCtrlConvert = tpProfessionalConfCtrlConvert;
    }
    
    public ConfCtrlService getConfCtrlService()
    {
        return confCtrlService;
    }
    
    public void setConfCtrlService(ConfCtrlService confCtrlService)
    {
        this.confCtrlService = confCtrlService;
    }
    
    /**
     * * @see com.huawei.esdk.tp.northcommu.cxf.professional.gen.
     * TPProfessionalConfCtr
     * #setBroadcastContinuousPresenceEx(com.huawei.esdk.tp.
     * northcommu.cxf.professional.gen.SetBroadcastContinuousPresenceEx)
     */
    @Override
    public SetBroadcastContinuousPresenceExResponse setBroadcastContinuousPresenceEx(
        SetBroadcastContinuousPresenceEx parameters)
    {
        SetBroadcastContinuousPresenceExResponse response = new SetBroadcastContinuousPresenceExResponse();
        SDKErrorCode errorCode = null;
        try
        {
            if (null == parameters)
            {
                response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
                return response;
            }
            errorCode =
                confCtrlService.setBroadcastContinuousPresenceEx(parameters.getConfId(), parameters.getIsBroadcast());
            response.setResultCode((int)errorCode.getErrCode());
        }
        catch (SDKException e)
        {
            LOGGER.error("setBroadcastContinuousPresenceEx method error", e);
            response.setResultCode((int)e.getSdkErrCode());
        }
        catch (Exception e)
        {
            LOGGER.error("setBroadcastContinuousPresenceEx method error", e);
            response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        }
        
        return response;
    }
    
    /**
     * * @see com.huawei.esdk.tp.northcommu.cxf.professional.gen.
     * TPProfessionalConfCtr
     * #setSitesQuietEx(com.huawei.esdk.tp.northcommu.cxf.professional
     * .gen.SetSitesQuietEx)
     */
    @Override
    public SetSitesQuietExResponse setSitesQuietEx(SetSitesQuietEx parameters)
    {
        SetSitesQuietExResponse response = new SetSitesQuietExResponse();
        SDKErrorCode errorCode = null;
        try
        {
            if (null == parameters || null == parameters.getSiteUris())
            {
                response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
                return response;
            }
            errorCode =
                confCtrlService.setSitesQuietEx(parameters.getConfId(),
                    parameters.getSiteUris(),
                    parameters.getIsQuiet());
            response.setResultCode((int)errorCode.getErrCode());
        }
        catch (SDKException e)
        {
            LOGGER.error("setSitesQuietEx method error", e);
            response.setResultCode((int)e.getSdkErrCode());
        }
        catch (Exception e)
        {
            LOGGER.error("setSitesQuietEx method error", e);
            response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        }
        
        return response;
    }
    
    /**
     * * @see com.huawei.esdk.tp.northcommu.cxf.professional.gen.
     * TPProfessionalConfCtr
     * #setAudioSwitchEx(com.huawei.esdk.tp.northcommu.cxf.professional
     * .gen.SetAudioSwitchEx)
     */
    @Override
    public SetAudioSwitchExResponse setAudioSwitchEx(SetAudioSwitchEx parameters)
    {
        SetAudioSwitchExResponse response = new SetAudioSwitchExResponse();
        SDKErrorCode errorCode = null;
        try
        {
            if (null == parameters)
            {
                response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
                return response;
            }
            errorCode =
                confCtrlService.setAudioSwitchEx(parameters.getConfId(),
                    parameters.getIsSwitch(),
                    parameters.getSwitchGate());
            response.setResultCode((int)errorCode.getErrCode());
        }
        catch (SDKException e)
        {
            LOGGER.error("setAudioSwitchEx method error", e);
            response.setResultCode((int)e.getSdkErrCode());
        }
        catch (Exception e)
        {
            LOGGER.error("setAudioSwitchEx method error", e);
            response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        }
        return response;
    }
    
    /**
     * * @see com.huawei.esdk.tp.northcommu.cxf.professional.gen.
     * TPProfessionalConfCtr
     * #setBroadcastSiteEx(com.huawei.esdk.tp.northcommu.cxf
     * .professional.gen.SetBroadcastSiteEx)
     */
    @Override
    public SetBroadcastSiteExResponse setBroadcastSiteEx(SetBroadcastSiteEx parameters)
    {
        SetBroadcastSiteExResponse response = new SetBroadcastSiteExResponse();
        SDKErrorCode errorCode = null;
        try
        {
            if (null == parameters)
            {
                response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
                return response;
            }
            errorCode =
                confCtrlService.setBroadcastSiteEx(parameters.getConfId(),
                    parameters.getSiteUri(),
                    parameters.getIsBroadcast());
            response.setResultCode((int)errorCode.getErrCode());
        }
        catch (SDKException e)
        {
            LOGGER.error("setBroadcastSiteEx method error", e);
            response.setResultCode((int)e.getSdkErrCode());
        }
        catch (Exception e)
        {
            LOGGER.error("setBroadcastSiteEx method error", e);
            response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        }
        
        return response;
    }
    
    /**
     * * @see com.huawei.esdk.tp.northcommu.cxf.professional.gen.
     * TPProfessionalConfCtr
     * #setContinuousPresenceEx(com.huawei.esdk.tp.northcommu
     * .cxf.professional.gen.SetContinuousPresenceEx)
     */
    @Override
    public SetContinuousPresenceExResponse setContinuousPresenceEx(SetContinuousPresenceEx parameters)
    {
        SetContinuousPresenceExResponse response = new SetContinuousPresenceExResponse();
        ContinuousPresenceParam continuousPresenceParam = new ContinuousPresenceParam();
        SDKErrorCode errorCode = null;
        try
        {
            if (null == parameters || null == parameters.getSubPics())
            {
                response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
                return response;
            }
            continuousPresenceParam.setPresenceMode(parameters.getPresenceMode());
            continuousPresenceParam.setSubPics(parameters.getSubPics());
            continuousPresenceParam.setTarget(parameters.getTarget());
            
            errorCode = confCtrlService.setContinuousPresenceEx(parameters.getConfId(), continuousPresenceParam);
            response.setResultCode((int)errorCode.getErrCode());
        }
        catch (SDKException e)
        {
            LOGGER.error("setContinuousPresenceEx method error", e);
            response.setResultCode((int)e.getSdkErrCode());
        }
        catch (Exception e)
        {
            LOGGER.error("setContinuousPresenceEx method error", e);
            response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        }
        
        return response;
    }
    
    /**
     * * @see com.huawei.esdk.tp.northcommu.cxf.professional.gen.
     * TPProfessionalConfCtr
     * #setSitesMuteEx(com.huawei.esdk.tp.northcommu.cxf.professional
     * .gen.SetSitesMuteEx)
     */
    @Override
    public SetSitesMuteExResponse setSitesMuteEx(SetSitesMuteEx parameters)
    {
        SetSitesMuteExResponse response = new SetSitesMuteExResponse();
        SDKErrorCode errorCode = null;
        try
        {
            if (null == parameters || null == parameters.getSiteUris())
            {
                response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
                return response;
            }
            errorCode =
                confCtrlService.setSitesMuteEx(parameters.getConfId(), parameters.getSiteUris(), parameters.getIsMute());
            response.setResultCode((int)errorCode.getErrCode());
        }
        catch (SDKException e)
        {
            LOGGER.error("setSitesMuteEx method error", e);
            response.setResultCode((int)e.getSdkErrCode());
        }
        catch (Exception e)
        {
            LOGGER.error("setSitesMuteEx method error", e);
            response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        }
        
        return response;
    }
    
    /**
     * * @see com.huawei.esdk.tp.northcommu.cxf.professional.gen.
     * TPProfessionalConfCtr
     * #setVideoSourceEx(com.huawei.esdk.tp.northcommu.cxf.professional
     * .gen.SetVideoSourceEx)
     */
    @Override
    public SetVideoSourceExResponse setVideoSourceEx(SetVideoSourceEx parameters)
    {
        SetVideoSourceExResponse response = new SetVideoSourceExResponse();
        SDKErrorCode errorCode = null;
        try
        {
            if (null == parameters)
            {
                response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
                return response;
            }
            errorCode =
                confCtrlService.setVideoSourceEx(parameters.getConfId(),
                    parameters.getSiteUri(),
                    parameters.getVideoSourceUri(),
                    parameters.getIsLock());
        }
        catch (SDKException e)
        {
            LOGGER.error("setVideoSourceEx method error", e);
            errorCode = new SDKErrorCode();
            errorCode.setErrCode((int)e.getSdkErrCode());
        }
        catch (Exception e)
        {
            LOGGER.error("setVideoSourceEx method error", e);
            errorCode = new SDKErrorCode();
            errorCode.setErrCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        }
        response.setResultCode((int)errorCode.getErrCode());
        
        return response;
    }
    
    /** 
     * 设置会场音量值
     *
     * @param parameters 入参，包含会议ID和视频源所在会场信息
     * @return SetConfSiteVolumeExResponse 响应信息：0，失败返回相应错误码
     * @see eSDK TP V100R003C20
     */
    @Override
    public SetConfSiteVolumeExResponse setConfSiteVolumeEx(SetConfSiteVolumeEx parameters)
    {
        SetConfSiteVolumeExResponse response = new SetConfSiteVolumeExResponse();
        if (null == parameters || StringUtils.isEmpty(parameters.getConfId())
            || CollectionUtils.isEmpty(parameters.getSiteVolumes()))
        {
            response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
            return response;
        }
        
        if (!StringUtils.isUintNumber(parameters.getConfId()))
        {
            response.setResultCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
            return response;
        }
        
        SDKErrorCode result = new SDKErrorCode();
        try
        {
            result =
                confCtrlService.setConfSiteVolumeEx(parameters.getConfId(),
                    tpProfessionalConfCtrlConvert.siteVolumeExSoap2Model(parameters.getSiteVolumes()));
        }
        catch (SDKException e)
        {
            LOGGER.error("setConfSiteVolumeEx method error", e);
            result.setErrCode(e.getSdkErrCode());
        }
        catch (Exception e)
        {
            LOGGER.error("setConfSiteVolumeEx method error", e);
            result.setErrCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        }
        
        response.setResultCode((int)result.getErrCode());
        
        return response;
    }

    /** 
     * 关闭会议中会场的视频
     * 
     * @param parameters 入参，包含会议ID和视频源所在会场标识
     * @return SetFloorExResponse 响应信息：0，失败返回相应错误码
     * @see eSDK TP V100R003C20
     */
    @Override
    public HideConfSiteLocalVideoExResponse hideConfSiteLocalVideoEx(HideConfSiteLocalVideoEx parameters)
    {
        HideConfSiteLocalVideoExResponse response = new HideConfSiteLocalVideoExResponse();
        if (null == parameters || StringUtils.isEmpty(parameters.getConfId())
            || CollectionUtils.isEmpty(parameters.getSiteUris()))
        {
            response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
            return response;
        }
        
        if (!StringUtils.isUintNumber(parameters.getConfId()))
        {
            response.setResultCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
            return response;
        }
        
        SDKErrorCode result = new SDKErrorCode();
        try
        {
            result = confCtrlService.hideConfSiteLocalVideoEx(parameters.getConfId(), parameters.getSiteUris());
        }
        catch (SDKException e)
        {
            LOGGER.error("hideConfSiteLocalVideoEx method error", e);
            result.setErrCode((int)e.getSdkErrCode());
        }
        catch (Exception e)
        {
            LOGGER.error("hideConfSiteLocalVideoEx method error", e);
            result.setErrCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        }
        
        response.setResultCode((int)result.getErrCode());
        
        return response;
    }
    
    /**
     * 指定会场发言（点名发言）
     * 
     * @param parameters 入参，包含会议ID和视频源所在会场标识
     * @return SetFloorExResponse 响应信息：0，失败返回相应错误码
     * @see eSDK TP V100R003C20
     */
    @Override
    public SetFloorExResponse setFloorEx(SetFloorEx parameters)
    {
        SetFloorExResponse response = new SetFloorExResponse();
        
        if (null == parameters || StringUtils.isEmpty(parameters.getConfId())
            || StringUtils.isEmpty(parameters.getSiteUri()))
        {
            response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
            return response;
        }
        
        if (!StringUtils.isUintNumber(parameters.getConfId()))
        {
            response.setResultCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
            return response;
        }
        
        SDKErrorCode result = new SDKErrorCode();
        
        try
        {
            result = confCtrlService.setFloorEx(parameters.getConfId(), parameters.getSiteUri());
        }
        catch (SDKException e)
        {
            LOGGER.error("setFloorEx method error", e);
            result.setErrCode(e.getSdkErrCode());
        }
        catch (Exception e)
        {
            LOGGER.error("setFloorEx method error", e);
            result.setErrCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        }
        
        response.setResultCode((int)result.getErrCode());
        
        return response;
    }
    
    /** 
     * 打开会议中会场的视频
     * 
     * @param parameters 入参，包含会议ID和视频源所在会场标识列表
     * @return DisplayConfSiteLocalVideoExResponse 响应信息，成功：0，失败返回相应错误码
     * @see eSDK TP V100R003C20
     */
    @Override
    public DisplayConfSiteLocalVideoExResponse displayConfSiteLocalVideoEx(DisplayConfSiteLocalVideoEx parameters)
    {
        DisplayConfSiteLocalVideoExResponse response = new DisplayConfSiteLocalVideoExResponse();
        
        if (null == parameters || StringUtils.isEmpty(parameters.getConfId())
            || CollectionUtils.isEmpty(parameters.getSiteUris()))
        {
            response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
            return response;
        }
        
        if (!StringUtils.isUintNumber(parameters.getConfId()))
        {
            response.setResultCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
            return response;
        }
        
        SDKErrorCode result = new SDKErrorCode();
        try
        {
            result = confCtrlService.displayConfSiteLocalVideoEx(parameters.getConfId(), parameters.getSiteUris());
        }
        catch (SDKException e)
        {
            LOGGER.error("displayConfSiteLocalVideoEx method error", e);
            result.setErrCode((int)e.getSdkErrCode());
        }
        catch (Exception e)
        {
            LOGGER.error("displayConfSiteLocalVideoEx method error", e);
            result.setErrCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        }
        
        response.setResultCode((int)result.getErrCode());
        
        return response;
    }

    @Override
    public RequestConfChairExResponse requestConfChairEx(RequestConfChairEx parameters)
    {
        RequestConfChairExResponse response = new RequestConfChairExResponse();
        
        if (null == parameters || StringUtils.isEmpty(parameters.getChairmanUri())
            || StringUtils.isEmpty(parameters.getConfId()))
        {
            response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
            return response;
        }
        
        if (!StringUtils.isUintNumber(parameters.getConfId()))
        {
            response.setResultCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
            return response;
        }
        
        SDKErrorCode result = null;
        
        try
        {
            result = confCtrlService.requestConfChairEx(parameters.getConfId(), parameters.getChairmanUri());
        }
        catch (SDKException e)
        {
            LOGGER.error("requestConfChairEx method error", e);
            response.setResultCode((int)e.getSdkErrCode());
            return response;
        }
        catch (Exception e)
        {
            LOGGER.error("requestConfChairEx method error", e);
            response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
            return response;
        }
        
        response.setResultCode((int)result.getErrCode());
        return response;
    }
    
    @Override
    public ReleaseConfChairExResponse releaseConfChairEx(ReleaseConfChairEx parameters)
    {
        ReleaseConfChairExResponse response = new ReleaseConfChairExResponse();
        
        if (null == parameters || StringUtils.isEmpty(parameters.getConfId()))
        {
            response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
            return response;
        }
        
        if (!StringUtils.isUintNumber(parameters.getConfId()))
        {
            response.setResultCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
            return response;
        }
        
        SDKErrorCode result = null;
        
        try
        {
            result = confCtrlService.releaseConfChairEx(parameters.getConfId());
        }
        catch (SDKException e)
        {
            LOGGER.error("releaseConfChairEx method error", e);
            response.setResultCode((int)e.getSdkErrCode());
            return response;
        }
        catch (Exception e)
        {
            LOGGER.error("releaseConfChairEx method error", e);
            response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
            return response;
        }
        
        response.setResultCode((int)result.getErrCode());
        return response;
    }
    
    @Override
    public UnlockPresentationExResponse unlockPresentationEx(UnlockPresentationEx parameters)
    {
        UnlockPresentationExResponse response = new UnlockPresentationExResponse();
        
        if (null == parameters || StringUtils.isEmpty(parameters.getConfId()))
        {
            response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
            return response;
        }
        
        if (!StringUtils.isUintNumber(parameters.getConfId()))
        {
            response.setResultCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
            return response;
        }
        
        SDKErrorCode result = null;
        
        try
        {
            result = confCtrlService.unlockPresentationEx(parameters.getConfId());
        }
        catch (SDKException e)
        {
            LOGGER.error("unlockPresentationEx method error", e);
            response.setResultCode((int)e.getSdkErrCode());
            return response;
        }
        catch (Exception e)
        {
            LOGGER.error("unlockPresentationEx method error", e);
            response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
            return response;
        }
        
        response.setResultCode((int)result.getErrCode());
        return response;
    }
    
    @Override
    public LockPresentationExResponse lockPresentationEx(LockPresentationEx parameters)
    {
        LockPresentationExResponse response = new LockPresentationExResponse();
        
        if (null == parameters || StringUtils.isEmpty(parameters.getConfId())
            || StringUtils.isEmpty(parameters.getSiteUri()))
        {
            response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
            return response;
        }
        
        if (!StringUtils.isUintNumber(parameters.getConfId()))
        {
            response.setResultCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
            return response;
        }
        
        SDKErrorCode result = null;
        
        try
        {
            result = confCtrlService.lockPresentationEx(parameters.getConfId(), parameters.getSiteUri());
        }
        catch (SDKException e)
        {
            LOGGER.error("lockPresentationEx method error", e);
            response.setResultCode((int)e.getSdkErrCode());
            return response;
        }
        catch (Exception e)
        {
            LOGGER.error("lockPresentationEx method error", e);
            response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
            return response;
        }
        
        response.setResultCode((int)result.getErrCode());
        return response;
    }
    
}
